﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DataLayer;
using System.Data;

namespace BusinnessLogic
{
    public class InsertProduct
    {
        public void Insertproduct(string name)
        {
            dlinsertproduct prod = new dlinsertproduct();
            prod.InsertProduct(name);
        }

        public void Insertsprint(string titel, string description, DateTime begin, DateTime end, int productid, int teamid)
        {
            dlinsertproduct prod = new dlinsertproduct();
            prod.InsertSprint(titel, description, begin, end, productid, teamid);
        }

        public void Inserttask(string titel, string description, int estimated, int userid, int userstoryid)
        {
            dlinsertproduct prod = new dlinsertproduct();
            prod.InsertTask(titel, description, estimated, userid, userstoryid);
        }

        public int GetTeamidFromUserStory(int userstoryid)
        {
            int teamid;

            dlinsertproduct dlinserter = new dlinsertproduct();
            DataSet dts = new DataSet();
            dts = dlinserter.UserStoryTeam(userstoryid);
            teamid = (int)dts.Tables[0].Rows[0]["TeamId"];
            return teamid;
        }
    }
}
